const Email = require('../Email')
const path = require('path')

//@Bean
class ZcEmailService {


	//@Value(ZcEmailService.email-user)
	user;

	//@Value(ZcEmailService.email-pass)
	pass;

	//@Value(ZcEmailService.nick-name)
	nickName;

	//@Value(value=ZcEmailService.assert,force=false)
	assert = "emailAssert";

	//@Autowired
	springFactory;

	beanInit(){
		this.email = new Email(this.user,this.pass,this.nickName);
	}

	async sendHtml(userList,title,page,data){
		const {rootPath} = this.springFactory.args;
		return this.email.sendHtml(userList,title,path.join(rootPath,this.assert,page),data)
	}

	async sendMsg(userList,title,msg){
		return this.email.sendMsg(userList,title,msg)
	}



}

module.exports = {ZcEmailService}